// pages/video/video.js
import request from '../../utils/request'
Page({

  /**
   * 页面的初始数据
   */
  data: {
    // 导航栏数组
    navList: [],
    //确定是否为点中id
    navId: '',
    // 视频列表
    videoList: [],
    // 视频id
    videoId: '',
    isTriggered: false,
    videoUpdateTime: [] // 记录video播放的时长
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.getNavList()
  },
  //跳转至搜索页
  toSearch(){
    wx.navigateTo({
      url: '/pages/search/search',
    })
  },
  // 切换导航
  selecdId(e) {
    let navId = e.currentTarget.dataset.id
    // let navId = e.currentTarget.id
    this.setData({
      navId: navId,
      videoList: []
    })
    wx.showLoading({
      title: '正在加载...'
    })
    this.getVideoList(this.data.navId)
  },
  // 请求导航列表
  async getNavList() {
    let getNavData = await request('/video/group/list')
    let navData = getNavData.data.splice(0, 14)
    this.setData({
      navId: navData[0].id,
      navList: navData
    })
    //调用导航视频
    this.getVideoList(this.data.navId)
  },
  //请求导航视频
  async getVideoList(navId) {
    let getVideoData = await request('/video/group', {
      id: navId
    })
    wx.hideLoading()
    let index = 0;
    let videoList = getVideoData.datas.map(item => {
      item.id = index++
      return item
    })
    this.setData({
      videoList,
      isTriggered: false //关闭自定义下拉刷新
    })

  },
  // 处理多个视频同时   
  // VideoContext 实例
  handlePlay(e) {
    let vid = e.currentTarget.id //获取当前播放视频的id
    //第一次点击的时候,this.videoContext 没有值
    // 区分是否为当前视频,要不同视频才会执行stop
    // this.vid !== vid && this.videoContext && this.videoContext.stop()
    // this.vid = vid
    this.setData({
      videoId: vid
    })
    this.videoContext = wx.createVideoContext(vid)
    // 判断当前的视频之前是否播放过，是否有播放记录, 如果有，跳转至指定的播放位置
    let {videoUpdateTime} = this.data;
    let videoItem = videoUpdateTime.find(item => item.vid === vid);
    if(videoItem){
      this.videoContext.seek(videoItem.currentTime);
    }
    this.videoContext.play()
  },
  //记录视频播放时长
  handleTimeUpdate(event){
    let videoTimeObj = {vid: event.currentTarget.id, currentTime: event.detail.currentTime};
    let {videoUpdateTime} = this.data
    /*
      是否有当前播放时长
      1.如果存在 则更新播放时间
      2.如果不存在 则push
    */
    let videoItem = videoUpdateTime.find(item=>
      item.vid === videoTimeObj.vid //如果相等则为同一个
    )
    if(videoItem) {
      videoItem.currentTime = event.detail.currentTime;
    }else {
      videoUpdateTime.push(videoTimeObj);
    }
     // 更新videoUpdateTime的状态
     this.setData({
      videoUpdateTime
    })


    // let videoItem = videoUpdateTime.find(item => item.vid === videoTimeObj.vid);
    // if(videoItem){ // 之前有
    //   videoItem.currentTime = event.detail.currentTime;
    // }else { // 之前没有
    //   videoUpdateTime.push(videoTimeObj);
    // }
    // // 更新videoUpdateTime的状态
    // this.setData({
    //   videoUpdateTime
    // })
  },
  // 视频播放结束 
  handleEnded(event){
    // 移除记录播放时长数组中当前视频的对象
    let {videoUpdateTime} = this.data
    videoUpdateTime.splice(videoUpdateTime.findIndex(item=>item.vid===event.currentTarget.id),1)
    this.setData({
      videoUpdateTime
    })
  },
  // 滚动到顶部
  handleRefresher() {
    //滚动到顶部,请求数据,获取最新
    this.getVideoList(this.data.navId)
  },
  // 触发底部
  handleToLower() {
    // 触发底部,加载更多,push到原有的数据上
    //模拟数据
    let newVideoList = [{
      "type": 1,
      "displayed": false,
      "alg": "onlineHotGroup",
      "extAlg": null,
      "data": {
        "alg": "onlineHotGroup",
        "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
        "threadId": "R_VI_62_9CD0619E8ADA5D147D7A99385D51571E",
        "coverUrl": "https://p1.music.126.net/fiPVJRZLGivs99orfd6EWA==/109951164301028483.jpg",
        "height": 1080,
        "width": 1920,
        "title": "全球唯一一个敢在世界舞台上杵90秒摆pose的男人 至今无",
        "description": "全球唯一一个敢在世界舞台上杵90秒摆pose的男人 至今无人可及",
        "commentCount": 294,
        "shareCount": 84,
        "resolutions": [{
          "resolution": 240,
          "size": 43619610
        }, {
          "resolution": 480,
          "size": 72683615
        }, {
          "resolution": 720,
          "size": 111223745
        }, {
          "resolution": 1080,
          "size": 170620456
        }],
        "creator": {
          "defaultAvatar": false,
          "province": 320000,
          "authStatus": 0,
          "followed": false,
          "avatarUrl": "http://p1.music.126.net/kp9yucXbg47UYp-iD8qKmw==/109951164186535005.jpg",
          "accountStatus": 0,
          "gender": 2,
          "city": 320100,
          "birthday": 1104681600000,
          "userId": 1844910842,
          "userType": 204,
          "nickname": "音悦留声",
          "signature": "本频道致力于推广最新的流行音乐、新人原创作品和好听的歌曲翻唱，\n把更多华语音乐中潜藏的音乐达人推荐给大家，希望大家多多支持~",
          "description": "",
          "detailDescription": "",
          "avatarImgId": 109951164186535000,
          "backgroundImgId": 109951165424649820,
          "backgroundUrl": "http://p1.music.126.net/PHPJLipW-QACxLrAbaGlcw==/109951165424649829.jpg",
          "authority": 0,
          "mutual": false,
          "expertTags": null,
          "experts": {
            "1": "音乐视频达人"
          },
          "djStatus": 0,
          "vipType": 0,
          "remarkName": null,
          "avatarImgIdStr": "109951164186535005",
          "backgroundImgIdStr": "109951165424649829"
        },
        "urlInfo": {
          "id": "9CD0619E8ADA5D147D7A99385D51571E",
          "url": "http://vodkgeyttp9.vod.126.net/vodkgeyttp8/iaTsMK2B_2607560143_uhd.mp4?ts=1626688592&rid=B38FBDA3D344E5C8ACE3974EF4B61711&rl=3&rs=RNGssXaIztCizaBZoUDkXODbKZKDlbdU&sign=15f8e781569231e6a38e0a20b2edc6ba&ext=FP7PYoEh0lMPpVY2vG%2BgPY0v3Xc9jOqvfcKGzhLSsy97pW1mOiVF3fHE5qPEaoKkxdqP%2BM1m6mlhYRQjadYaZGmMqrwAQEqf91HeSu1Ft0J%2F4EgsrPvdh7irhrjX0yZbySP%2BWNZKdOM%2BhtGEDdk4KM9Slhm5FVv6aC0l9dZ3ApvgfdCWdkKdhwrfswug5ruS1dw%2B4NPeKo4JzocPaCp4oljLPqZWYHegaRC4SXk%2F%2FKOuBY5jM%2Fi2qOeQ4eyDmmqr",
          "size": 170620456,
          "validityTime": 1200,
          "needPay": false,
          "payInfo": null,
          "r": 1080
        },
        "videoGroup": [{
          "id": 58100,
          "name": "现场",
          "alg": null
        }, {
          "id": 1100,
          "name": "音乐现场",
          "alg": null
        }, {
          "id": 5100,
          "name": "音乐",
          "alg": null
        }],
        "previewUrl": null,
        "previewDurationms": 0,
        "hasRelatedGameAd": false,
        "markTypes": null,
        "relateSong": [],
        "relatedInfo": null,
        "videoUserLiveInfo": null,
        "vid": "9CD0619E8ADA5D147D7A99385D51571E",
        "durationms": 244928,
        "playTime": 585785,
        "praisedCount": 2171,
        "praised": false,
        "subscribed": false
      }
    }, {
      "type": 1,
      "displayed": false,
      "alg": "onlineHotGroup",
      "extAlg": null,
      "data": {
        "alg": "onlineHotGroup",
        "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
        "threadId": "R_VI_62_8F9BB19518CBFA14708BD4641DBB7A9A",
        "coverUrl": "https://p1.music.126.net/K_venVylnIiwcGhIDdNzXA==/109951163572792521.jpg",
        "height": 720,
        "width": 1280,
        "title": "被演技耽误的歌手古天乐开口唱歌，郑秀文台上尖叫，观众台下欢呼",
        "description": "Sammi演唱完《我们的主题曲》，演唱会压轴嘉宾古天乐出场，古仔被Sammi玩坏了，呼啦啦啦啦。要求唱歌，被演技耽误的歌手古天乐开口唱歌，演唱哥哥的歌曲《当年情》，郑秀文台上尖叫，观众台下欢呼。",
        "commentCount": 2651,
        "shareCount": 2728,
        "resolutions": [{
          "resolution": 240,
          "size": 49498335
        }, {
          "resolution": 480,
          "size": 70374345
        }, {
          "resolution": 720,
          "size": 111985504
        }],
        "creator": {
          "defaultAvatar": false,
          "province": 330000,
          "authStatus": 0,
          "followed": false,
          "avatarUrl": "http://p1.music.126.net/-MZDEHaFdvQtdIdY2fDgyw==/109951164877618139.jpg",
          "accountStatus": 0,
          "gender": 1,
          "city": 330100,
          "birthday": 841507200000,
          "userId": 268678989,
          "userType": 200,
          "nickname": "随身音乐厅",
          "signature": "音乐的魅力，在于人的精神与音乐的共鸣。",
          "description": "",
          "detailDescription": "",
          "avatarImgId": 109951164877618140,
          "backgroundImgId": 109951165866068220,
          "backgroundUrl": "http://p1.music.126.net/Msq8ASEUsD0nrXiDROSdmQ==/109951165866068231.jpg",
          "authority": 0,
          "mutual": false,
          "expertTags": ["华语"],
          "experts": {
            "1": "音乐视频达人",
            "2": "生活图文达人"
          },
          "djStatus": 10,
          "vipType": 11,
          "remarkName": null,
          "avatarImgIdStr": "109951164877618139",
          "backgroundImgIdStr": "109951165866068231"
        },
        "urlInfo": {
          "id": "8F9BB19518CBFA14708BD4641DBB7A9A",
          "url": "http://vodkgeyttp9.vod.126.net/vodkgeyttp8/41X4zD7v_107161222_shd.mp4?ts=1626688592&rid=B38FBDA3D344E5C8ACE3974EF4B61711&rl=3&rs=JWlfFnGnyBGEkIomUrnGQSMXnathUUza&sign=365c64893db5791fec23212866bafacd&ext=FP7PYoEh0lMPpVY2vG%2BgPY0v3Xc9jOqvfcKGzhLSsy97pW1mOiVF3fHE5qPEaoKkxdqP%2BM1m6mlhYRQjadYaZGmMqrwAQEqf91HeSu1Ft0J%2F4EgsrPvdh7irhrjX0yZbySP%2BWNZKdOM%2BhtGEDdk4KM9Slhm5FVv6aC0l9dZ3ApvgfdCWdkKdhwrfswug5ruS1dw%2B4NPeKo4JzocPaCp4oljLPqZWYHegaRC4SXk%2F%2FKOuBY5jM%2Fi2qOeQ4eyDmmqr",
          "size": 111985504,
          "validityTime": 1200,
          "needPay": false,
          "payInfo": null,
          "r": 720
        },
        "videoGroup": [{
          "id": 58100,
          "name": "现场",
          "alg": null
        }, {
          "id": 9102,
          "name": "演唱会",
          "alg": null
        }, {
          "id": 57105,
          "name": "粤语现场",
          "alg": null
        }, {
          "id": 57108,
          "name": "流行现场",
          "alg": null
        }, {
          "id": 1100,
          "name": "音乐现场",
          "alg": null
        }, {
          "id": 5100,
          "name": "音乐",
          "alg": null
        }],
        "previewUrl": null,
        "previewDurationms": 0,
        "hasRelatedGameAd": false,
        "markTypes": null,
        "relateSong": [],
        "relatedInfo": null,
        "videoUserLiveInfo": null,
        "vid": "8F9BB19518CBFA14708BD4641DBB7A9A",
        "durationms": 421130,
        "playTime": 6423740,
        "praisedCount": 30129,
        "praised": false,
        "subscribed": false
      }
    }, {
      "type": 1,
      "displayed": false,
      "alg": "onlineHotGroup",
      "extAlg": null,
      "data": {
        "alg": "onlineHotGroup",
        "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
        "threadId": "R_VI_62_179DF549E8712FDC8B51DDB3C0396C85",
        "coverUrl": "https://p1.music.126.net/XpEscQeYSePa55LTvdZ14g==/109951164947772483.jpg",
        "height": 1080,
        "width": 1920,
        "title": "《我们的爱 (Live)》看黄霄云唱出心碎的感觉",
        "description": "《我们的爱 (Live)》看黄霄云唱出心碎的感觉",
        "commentCount": 163,
        "shareCount": 193,
        "resolutions": [{
          "resolution": 240,
          "size": 28350979
        }, {
          "resolution": 480,
          "size": 43853434
        }, {
          "resolution": 720,
          "size": 62388616
        }, {
          "resolution": 1080,
          "size": 116915896
        }],
        "creator": {
          "defaultAvatar": false,
          "province": 370000,
          "authStatus": 0,
          "followed": false,
          "avatarUrl": "http://p1.music.126.net/Lv0XvH2xZI6vx4_Lbjrvzw==/109951164901414960.jpg",
          "accountStatus": 0,
          "gender": 2,
          "city": 370600,
          "birthday": 1520006400000,
          "userId": 3288977853,
          "userType": 204,
          "nickname": "我爱纯牛奶哦",
          "signature": "",
          "description": "",
          "detailDescription": "",
          "avatarImgId": 109951164901414960,
          "backgroundImgId": 109951162868126480,
          "backgroundUrl": "http://p1.music.126.net/_f8R60U9mZ42sSNvdPn2sQ==/109951162868126486.jpg",
          "authority": 0,
          "mutual": false,
          "expertTags": null,
          "experts": {
            "1": "影视视频达人"
          },
          "djStatus": 0,
          "vipType": 0,
          "remarkName": null,
          "avatarImgIdStr": "109951164901414960",
          "backgroundImgIdStr": "109951162868126486"
        },
        "urlInfo": {
          "id": "179DF549E8712FDC8B51DDB3C0396C85",
          "url": "http://vodkgeyttp9.vod.126.net/vodkgeyttp8/KGCiqq8C_2984099111_uhd.mp4?ts=1626688592&rid=B38FBDA3D344E5C8ACE3974EF4B61711&rl=3&rs=wHyrJtpRqshQofmaopHXjlZgsznhGJYC&sign=c4cdeda474d72beee5bf49603d3a382a&ext=FP7PYoEh0lMPpVY2vG%2BgPY0v3Xc9jOqvfcKGzhLSsy97pW1mOiVF3fHE5qPEaoKkxdqP%2BM1m6mlhYRQjadYaZGmMqrwAQEqf91HeSu1Ft0J%2F4EgsrPvdh7irhrjX0yZbySP%2BWNZKdOM%2BhtGEDdk4KM9Slhm5FVv6aC0l9dZ3ApvgfdCWdkKdhwrfswug5ruS1dw%2B4NPeKo4JzocPaCp4oljLPqZWYHegaRC4SXk%2F%2FKMuW9n%2BDiROtAjWr4w5e01G",
          "size": 116915896,
          "validityTime": 1200,
          "needPay": false,
          "payInfo": null,
          "r": 1080
        },
        "videoGroup": [{
          "id": 58100,
          "name": "现场",
          "alg": null
        }, {
          "id": 59101,
          "name": "华语现场",
          "alg": null
        }, {
          "id": 57108,
          "name": "流行现场",
          "alg": null
        }, {
          "id": 59108,
          "name": "巡演现场",
          "alg": null
        }, {
          "id": 1100,
          "name": "音乐现场",
          "alg": null
        }, {
          "id": 12100,
          "name": "流行",
          "alg": null
        }, {
          "id": 5100,
          "name": "音乐",
          "alg": null
        }, {
          "id": 23116,
          "name": "音乐推荐",
          "alg": null
        }, {
          "id": 15102,
          "name": "华语音乐",
          "alg": null
        }],
        "previewUrl": null,
        "previewDurationms": 0,
        "hasRelatedGameAd": false,
        "markTypes": null,
        "relateSong": [{
          "name": "我们的爱 (Live)",
          "id": 1440876675,
          "pst": 0,
          "t": 0,
          "ar": [{
            "id": 14077324,
            "name": "黄霄雲",
            "tns": [],
            "alias": []
          }],
          "alia": [],
          "pop": 100,
          "st": 0,
          "rt": "",
          "fee": 8,
          "v": 67,
          "crbt": null,
          "cf": "",
          "al": {
            "id": 88071850,
            "name": "歌手·当打之年 第11期",
            "picUrl": "http://p4.music.126.net/yfWZi32AbkxUehMKY_-utA==/109951164913076037.jpg",
            "tns": [],
            "pic_str": "109951164913076037",
            "pic": 109951164913076030
          },
          "dt": 323200,
          "h": {
            "br": 320000,
            "fid": 0,
            "size": 12930285,
            "vd": -44465
          },
          "m": {
            "br": 192000,
            "fid": 0,
            "size": 7758189,
            "vd": -41832
          },
          "l": {
            "br": 128000,
            "fid": 0,
            "size": 5172141,
            "vd": -40144
          },
          "a": null,
          "cd": "01",
          "no": 6,
          "rtUrl": null,
          "ftype": 0,
          "rtUrls": [],
          "djId": 0,
          "copyright": 0,
          "s_id": 0,
          "rtype": 0,
          "rurl": null,
          "mst": 9,
          "cp": 1416682,
          "mv": 0,
          "publishTime": 0,
          "privilege": {
            "id": 1440876675,
            "fee": 8,
            "payed": 0,
            "st": 0,
            "pl": 128000,
            "dl": 0,
            "sp": 7,
            "cp": 1,
            "subp": 1,
            "cs": false,
            "maxbr": 999000,
            "fl": 128000,
            "toast": false,
            "flag": 68,
            "preSell": false
          }
        }],
        "relatedInfo": null,
        "videoUserLiveInfo": null,
        "vid": "179DF549E8712FDC8B51DDB3C0396C85",
        "durationms": 315566,
        "playTime": 283162,
        "praisedCount": 2921,
        "praised": false,
        "subscribed": false
      }
    }, {
      "type": 1,
      "displayed": false,
      "alg": "onlineHotGroup",
      "extAlg": null,
      "data": {
        "alg": "onlineHotGroup",
        "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
        "threadId": "R_VI_62_3722F631D1F7A0921FFBE0449C328AF7",
        "coverUrl": "https://p1.music.126.net/Q6OiDx4x_D5_EgPTMHo0Xw==/109951163573399169.jpg",
        "height": 360,
        "width": 540,
        "title": "女朋友说这首歌不好听，然后我就把她换了。",
        "description": "女朋友说这首歌不好听，然后我就把她换了。",
        "commentCount": 2677,
        "shareCount": 3168,
        "resolutions": [{
          "resolution": 240,
          "size": 24405853
        }],
        "creator": {
          "defaultAvatar": false,
          "province": 110000,
          "authStatus": 0,
          "followed": false,
          "avatarUrl": "http://p1.music.126.net/5WuEwQsJpxqmJekOWEto-g==/109951165328068724.jpg",
          "accountStatus": 0,
          "gender": 1,
          "city": 110101,
          "birthday": 1483200000000,
          "userId": 473551421,
          "userType": 204,
          "nickname": "这音乐牛掰",
          "signature": "为人低调的音乐博主，投稿请私信",
          "description": "",
          "detailDescription": "",
          "avatarImgId": 109951165328068720,
          "backgroundImgId": 109951163462909980,
          "backgroundUrl": "http://p1.music.126.net/z4p1vQpYXhjk8x0ZSQM_jQ==/109951163462909982.jpg",
          "authority": 0,
          "mutual": false,
          "expertTags": null,
          "experts": {
            "1": "音乐视频达人"
          },
          "djStatus": 0,
          "vipType": 11,
          "remarkName": null,
          "avatarImgIdStr": "109951165328068724",
          "backgroundImgIdStr": "109951163462909982"
        },
        "urlInfo": {
          "id": "3722F631D1F7A0921FFBE0449C328AF7",
          "url": "http://vodkgeyttp9.vod.126.net/vodkgeyttp8/y5WRQBVh_1533002405_sd.mp4?ts=1626688592&rid=B38FBDA3D344E5C8ACE3974EF4B61711&rl=3&rs=MGmiWUQLiYSVKCSwHoFtNBAitmnrTmqL&sign=22cdfd17eb38bcd56dab52f92e7293e0&ext=FP7PYoEh0lMPpVY2vG%2BgPY0v3Xc9jOqvfcKGzhLSsy97pW1mOiVF3fHE5qPEaoKkxdqP%2BM1m6mlhYRQjadYaZGmMqrwAQEqf91HeSu1Ft0J%2F4EgsrPvdh7irhrjX0yZbySP%2BWNZKdOM%2BhtGEDdk4KM9Slhm5FVv6aC0l9dZ3ApvgfdCWdkKdhwrfswug5ruS1dw%2B4NPeKo4JzocPaCp4oljLPqZWYHegaRC4SXk%2F%2FKMuW9n%2BDiROtAjWr4w5e01G",
          "size": 24405853,
          "validityTime": 1200,
          "needPay": false,
          "payInfo": null,
          "r": 240
        },
        "videoGroup": [{
          "id": 58100,
          "name": "现场",
          "alg": null
        }, {
          "id": 57105,
          "name": "粤语现场",
          "alg": null
        }, {
          "id": 57108,
          "name": "流行现场",
          "alg": null
        }, {
          "id": 59108,
          "name": "巡演现场",
          "alg": null
        }, {
          "id": 1100,
          "name": "音乐现场",
          "alg": null
        }, {
          "id": 5100,
          "name": "音乐",
          "alg": null
        }],
        "previewUrl": null,
        "previewDurationms": 0,
        "hasRelatedGameAd": false,
        "markTypes": [109],
        "relateSong": [],
        "relatedInfo": null,
        "videoUserLiveInfo": null,
        "vid": "3722F631D1F7A0921FFBE0449C328AF7",
        "durationms": 211245,
        "playTime": 5178475,
        "praisedCount": 14820,
        "praised": false,
        "subscribed": false
      }
    }, {
      "type": 1,
      "displayed": false,
      "alg": "onlineHotGroup",
      "extAlg": null,
      "data": {
        "alg": "onlineHotGroup",
        "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
        "threadId": "R_VI_62_682198CEA910671AA3F5E28E4D4BDC99",
        "coverUrl": "https://p1.music.126.net/V9soNG5srFXFeTr76_Ee_A==/109951165144423114.jpg",
        "height": 1080,
        "width": 1920,
        "title": "Rosé Solo 罗婕女士赤脚 事情绝对不简单！都进来看仙女",
        "description": "Someone You Loved (Solo Stage)\n朴彩英啊啊啊啊！！你太美了！！！！！",
        "commentCount": 409,
        "shareCount": 1767,
        "resolutions": [{
          "resolution": 240,
          "size": 18175379
        }, {
          "resolution": 480,
          "size": 29931257
        }, {
          "resolution": 720,
          "size": 44060757
        }, {
          "resolution": 1080,
          "size": 81682737
        }],
        "creator": {
          "defaultAvatar": false,
          "province": 110000,
          "authStatus": 0,
          "followed": false,
          "avatarUrl": "http://p1.music.126.net/MX9saEx_ZVikAGarPOcTzg==/109951165044871751.jpg",
          "accountStatus": 0,
          "gender": 2,
          "city": 110101,
          "birthday": -2209017600000,
          "userId": 3359247845,
          "userType": 0,
          "nickname": "茜茜Xi_",
          "signature": "",
          "description": "",
          "detailDescription": "",
          "avatarImgId": 109951165044871740,
          "backgroundImgId": 109951162868126480,
          "backgroundUrl": "http://p1.music.126.net/_f8R60U9mZ42sSNvdPn2sQ==/109951162868126486.jpg",
          "authority": 0,
          "mutual": false,
          "expertTags": null,
          "experts": null,
          "djStatus": 0,
          "vipType": 0,
          "remarkName": null,
          "avatarImgIdStr": "109951165044871751",
          "backgroundImgIdStr": "109951162868126486"
        },
        "urlInfo": {
          "id": "682198CEA910671AA3F5E28E4D4BDC99",
          "url": "http://vodkgeyttp9.vod.126.net/vodkgeyttp8/atCw6xoL_3060115685_uhd.mp4?ts=1626688592&rid=B38FBDA3D344E5C8ACE3974EF4B61711&rl=3&rs=aiXmRRxXekqkCpeJUKTcOAkSaAyQWYBZ&sign=7cd1f45a31d8ef11e1f68c3da743fd75&ext=FP7PYoEh0lMPpVY2vG%2BgPY0v3Xc9jOqvfcKGzhLSsy97pW1mOiVF3fHE5qPEaoKkxdqP%2BM1m6mlhYRQjadYaZGmMqrwAQEqf91HeSu1Ft0J%2F4EgsrPvdh7irhrjX0yZbySP%2BWNZKdOM%2BhtGEDdk4KM9Slhm5FVv6aC0l9dZ3ApvgfdCWdkKdhwrfswug5ruS1dw%2B4NPeKo4JzocPaCp4oljLPqZWYHegaRC4SXk%2F%2FKOuBY5jM%2Fi2qOeQ4eyDmmqr",
          "size": 81682737,
          "validityTime": 1200,
          "needPay": false,
          "payInfo": null,
          "r": 1080
        },
        "videoGroup": [{
          "id": 58100,
          "name": "现场",
          "alg": null
        }, {
          "id": 1101,
          "name": "舞蹈",
          "alg": null
        }, {
          "id": 57106,
          "name": "欧美现场",
          "alg": null
        }, {
          "id": 57108,
          "name": "流行现场",
          "alg": null
        }, {
          "id": 57110,
          "name": "饭拍现场",
          "alg": null
        }, {
          "id": 1100,
          "name": "音乐现场",
          "alg": null
        }, {
          "id": 5100,
          "name": "音乐",
          "alg": null
        }, {
          "id": 92105,
          "name": "BLACKPINK",
          "alg": null
        }],
        "previewUrl": null,
        "previewDurationms": 0,
        "hasRelatedGameAd": false,
        "markTypes": null,
        "relateSong": [{
          "name": "Someone You Loved",
          "id": 1393230495,
          "pst": 0,
          "t": 0,
          "ar": [{
            "id": 29020,
            "name": "Conor Maynard",
            "tns": [],
            "alias": []
          }],
          "alia": [],
          "pop": 100,
          "st": 0,
          "rt": "",
          "fee": 1,
          "v": 5,
          "crbt": null,
          "cf": "",
          "al": {
            "id": 81926125,
            "name": "Someone You Loved",
            "picUrl": "http://p3.music.126.net/vt_HmF9ESBX4ksoSczbedQ==/109951164386298311.jpg",
            "tns": [],
            "pic_str": "109951164386298311",
            "pic": 109951164386298300
          },
          "dt": 148271,
          "h": {
            "br": 320000,
            "fid": 0,
            "size": 5931929,
            "vd": -53577
          },
          "m": {
            "br": 192000,
            "fid": 0,
            "size": 3559175,
            "vd": -50974
          },
          "l": {
            "br": 128000,
            "fid": 0,
            "size": 2372798,
            "vd": -49255
          },
          "a": null,
          "cd": "01",
          "no": 1,
          "rtUrl": null,
          "ftype": 0,
          "rtUrls": [],
          "djId": 0,
          "copyright": 1,
          "s_id": 0,
          "rtype": 0,
          "rurl": null,
          "mst": 9,
          "cp": 7002,
          "mv": 10891308,
          "publishTime": 1569513600000,
          "privilege": {
            "id": 1393230495,
            "fee": 1,
            "payed": 0,
            "st": 0,
            "pl": 0,
            "dl": 0,
            "sp": 0,
            "cp": 0,
            "subp": 0,
            "cs": false,
            "maxbr": 320000,
            "fl": 0,
            "toast": false,
            "flag": 260,
            "preSell": false
          }
        }, {
          "name": "Someone You Loved（翻自 朴彩英ROSÉ） ",
          "id": 1408650710,
          "pst": 0,
          "t": 0,
          "ar": [{
            "id": 28182478,
            "name": "Oh_MacyLin",
            "tns": [],
            "alias": []
          }],
          "alia": [],
          "pop": 35,
          "st": 0,
          "rt": "",
          "fee": 0,
          "v": 6,
          "crbt": null,
          "cf": "",
          "al": {
            "id": 83923322,
            "name": "Someone You Loved ROSÉ朴彩英",
            "picUrl": "http://p4.music.126.net/PukXh26p78Q7sYfbL-pPxQ==/109951164539693660.jpg",
            "tns": [],
            "pic_str": "109951164539693660",
            "pic": 109951164539693660
          },
          "dt": 183681,
          "h": {
            "br": 320000,
            "fid": 0,
            "size": 7349856,
            "vd": 9682
          },
          "m": {
            "br": 192000,
            "fid": 0,
            "size": 4409931,
            "vd": 12325
          },
          "l": {
            "br": 128000,
            "fid": 0,
            "size": 2939968,
            "vd": 14233
          },
          "a": null,
          "cd": "01",
          "no": 1,
          "rtUrl": null,
          "ftype": 0,
          "rtUrls": [],
          "djId": 0,
          "copyright": 0,
          "s_id": 0,
          "rtype": 0,
          "rurl": null,
          "mst": 9,
          "cp": 0,
          "mv": 0,
          "publishTime": 0,
          "privilege": {
            "id": 1408650710,
            "fee": 0,
            "payed": 0,
            "st": 0,
            "pl": 320000,
            "dl": 999000,
            "sp": 7,
            "cp": 1,
            "subp": 1,
            "cs": false,
            "maxbr": 999000,
            "fl": 320000,
            "toast": false,
            "flag": 128,
            "preSell": false
          }
        }],
        "relatedInfo": null,
        "videoUserLiveInfo": null,
        "vid": "682198CEA910671AA3F5E28E4D4BDC99",
        "durationms": 182485,
        "playTime": 1920355,
        "praisedCount": 32318,
        "praised": false,
        "subscribed": false
      }
    }, {
      "type": 1,
      "displayed": false,
      "alg": "onlineHotGroup",
      "extAlg": null,
      "data": {
        "alg": "onlineHotGroup",
        "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
        "threadId": "R_VI_62_46D19F88CCFC789D05335F8702023052",
        "coverUrl": "https://p1.music.126.net/XmcP4RGnJbn_7rRb1XFAuA==/109951163574170795.jpg",
        "height": 720,
        "width": 1280,
        "title": "金泫雅-red-2017waterbomb",
        "description": "金泫雅-red-2017waterbomb，泫雅穿高跟鞋不要滑倒呀~",
        "commentCount": 1107,
        "shareCount": 1878,
        "resolutions": [{
          "resolution": 240,
          "size": 28060020
        }, {
          "resolution": 480,
          "size": 47400490
        }, {
          "resolution": 720,
          "size": 65437351
        }],
        "creator": {
          "defaultAvatar": false,
          "province": 110000,
          "authStatus": 0,
          "followed": false,
          "avatarUrl": "http://p1.music.126.net/d8IOocTfI0i5t_doz5Kcpg==/109951163422792380.jpg",
          "accountStatus": 0,
          "gender": 2,
          "city": 110101,
          "birthday": 905702400000,
          "userId": 1332534736,
          "userType": 0,
          "nickname": "MC98妹",
          "signature": "是你的98K。有空来看看，没事来赞赞。",
          "description": "",
          "detailDescription": "",
          "avatarImgId": 109951163422792380,
          "backgroundImgId": 109951163423624770,
          "backgroundUrl": "http://p1.music.126.net/ZxGwGBEudRaRR8pmgH47Cg==/109951163423624761.jpg",
          "authority": 0,
          "mutual": false,
          "expertTags": null,
          "experts": {
            "1": "音乐视频达人"
          },
          "djStatus": 0,
          "vipType": 0,
          "remarkName": null,
          "avatarImgIdStr": "109951163422792380",
          "backgroundImgIdStr": "109951163423624761"
        },
        "urlInfo": {
          "id": "46D19F88CCFC789D05335F8702023052",
          "url": "http://vodkgeyttp9.vod.126.net/vodkgeyttp8/lJzsWXDt_1884031799_shd.mp4?ts=1626688592&rid=B38FBDA3D344E5C8ACE3974EF4B61711&rl=3&rs=zZSEFubZcfioXMWcxDpUkQMXNAFEJoKJ&sign=a315036eb223180ee014fa3e68ed9abc&ext=FP7PYoEh0lMPpVY2vG%2BgPY0v3Xc9jOqvfcKGzhLSsy97pW1mOiVF3fHE5qPEaoKkxdqP%2BM1m6mlhYRQjadYaZGmMqrwAQEqf91HeSu1Ft0J%2F4EgsrPvdh7irhrjX0yZbySP%2BWNZKdOM%2BhtGEDdk4KM9Slhm5FVv6aC0l9dZ3ApvgfdCWdkKdhwrfswug5ruS1dw%2B4NPeKo4JzocPaCp4oljLPqZWYHegaRC4SXk%2F%2FKMuW9n%2BDiROtAjWr4w5e01G",
          "size": 65437351,
          "validityTime": 1200,
          "needPay": false,
          "payInfo": null,
          "r": 720
        },
        "videoGroup": [{
          "id": 58100,
          "name": "现场",
          "alg": null
        }, {
          "id": 1101,
          "name": "舞蹈",
          "alg": null
        }, {
          "id": 57107,
          "name": "韩语现场",
          "alg": null
        }, {
          "id": 57108,
          "name": "流行现场",
          "alg": null
        }, {
          "id": 59108,
          "name": "巡演现场",
          "alg": null
        }, {
          "id": 1100,
          "name": "音乐现场",
          "alg": null
        }, {
          "id": 12100,
          "name": "流行",
          "alg": null
        }, {
          "id": 5100,
          "name": "音乐",
          "alg": null
        }, {
          "id": 14146,
          "name": "兴奋",
          "alg": null
        }],
        "previewUrl": null,
        "previewDurationms": 0,
        "hasRelatedGameAd": false,
        "markTypes": null,
        "relateSong": [{
          "name": "빨개요",
          "id": 28850659,
          "pst": 0,
          "t": 0,
          "ar": [{
            "id": 126066,
            "name": "泫雅",
            "tns": [],
            "alias": []
          }],
          "alia": [],
          "pop": 100,
          "st": 0,
          "rt": null,
          "fee": 8,
          "v": 45,
          "crbt": null,
          "cf": "",
          "al": {
            "id": 2915127,
            "name": "A Talk",
            "picUrl": "http://p4.music.126.net/NlUsxpunCztACmXv6qxbhA==/6656443394676222.jpg",
            "tns": [],
            "pic": 6656443394676222
          },
          "dt": 199799,
          "h": {
            "br": 320000,
            "fid": 0,
            "size": 7994558,
            "vd": -90490
          },
          "m": {
            "br": 192000,
            "fid": 0,
            "size": 4796752,
            "vd": -87950
          },
          "l": {
            "br": 128000,
            "fid": 0,
            "size": 3197849,
            "vd": -86241
          },
          "a": null,
          "cd": "1",
          "no": 3,
          "rtUrl": null,
          "ftype": 0,
          "rtUrls": [],
          "djId": 0,
          "copyright": 1,
          "s_id": 0,
          "rtype": 0,
          "rurl": null,
          "mst": 9,
          "cp": 1415873,
          "mv": 303071,
          "publishTime": 1406476800007,
          "tns": ["Red"],
          "privilege": {
            "id": 28850659,
            "fee": 8,
            "payed": 0,
            "st": 0,
            "pl": 128000,
            "dl": 0,
            "sp": 7,
            "cp": 1,
            "subp": 1,
            "cs": false,
            "maxbr": 999000,
            "fl": 128000,
            "toast": false,
            "flag": 68,
            "preSell": false
          }
        }],
        "relatedInfo": null,
        "videoUserLiveInfo": null,
        "vid": "46D19F88CCFC789D05335F8702023052",
        "durationms": 188437,
        "playTime": 4097522,
        "praisedCount": 15244,
        "praised": false,
        "subscribed": false
      }
    }, {
      "type": 1,
      "displayed": false,
      "alg": "onlineHotGroup",
      "extAlg": null,
      "data": {
        "alg": "onlineHotGroup",
        "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
        "threadId": "R_VI_62_D2669D47F7011995AED7B88D058FD013",
        "coverUrl": "https://p1.music.126.net/t0eSpeyX7dBI3pzKRTV4qw==/109951163725630341.jpg",
        "height": 720,
        "width": 1280,
        "title": "崔子格 一首《卜卦》，听了那么多年，怎么听都不够！",
        "description": "崔子格 一首《卜卦》，听了那么多年，怎么听都不够！",
        "commentCount": 1196,
        "shareCount": 3394,
        "resolutions": [{
          "resolution": 240,
          "size": 23063424
        }, {
          "resolution": 480,
          "size": 39170623
        }, {
          "resolution": 720,
          "size": 67630971
        }],
        "creator": {
          "defaultAvatar": false,
          "province": 450000,
          "authStatus": 0,
          "followed": false,
          "avatarUrl": "http://p1.music.126.net/OvMvp3KTR215HKWOZ-jvcw==/109951163716272270.jpg",
          "accountStatus": 0,
          "gender": 0,
          "city": 450100,
          "birthday": 542390400000,
          "userId": 1694861984,
          "userType": 0,
          "nickname": "丽枫玉玉",
          "signature": "分享好音乐好音质的唯美歌曲",
          "description": "",
          "detailDescription": "",
          "avatarImgId": 109951163716272270,
          "backgroundImgId": 109951162868126480,
          "backgroundUrl": "http://p1.music.126.net/_f8R60U9mZ42sSNvdPn2sQ==/109951162868126486.jpg",
          "authority": 0,
          "mutual": false,
          "expertTags": null,
          "experts": null,
          "djStatus": 0,
          "vipType": 0,
          "remarkName": null,
          "avatarImgIdStr": "109951163716272270",
          "backgroundImgIdStr": "109951162868126486"
        },
        "urlInfo": {
          "id": "D2669D47F7011995AED7B88D058FD013",
          "url": "http://vodkgeyttp9.vod.126.net/vodkgeyttp8/L6OFMnB9_2186485187_shd.mp4?ts=1626688592&rid=B38FBDA3D344E5C8ACE3974EF4B61711&rl=3&rs=LZybgUYPPlQiuMtegpkRGDVHmLHDiltL&sign=f773d7056f4a4d33c0ae0d6a5700a507&ext=FP7PYoEh0lMPpVY2vG%2BgPY0v3Xc9jOqvfcKGzhLSsy97pW1mOiVF3fHE5qPEaoKkxdqP%2BM1m6mlhYRQjadYaZGmMqrwAQEqf91HeSu1Ft0J%2F4EgsrPvdh7irhrjX0yZbySP%2BWNZKdOM%2BhtGEDdk4KM9Slhm5FVv6aC0l9dZ3ApvgfdCWdkKdhwrfswug5ruS1dw%2B4NPeKo4JzocPaCp4oljLPqZWYHegaRC4SXk%2F%2FKMuW9n%2BDiROtAjWr4w5e01G",
          "size": 67630971,
          "validityTime": 1200,
          "needPay": false,
          "payInfo": null,
          "r": 720
        },
        "videoGroup": [{
          "id": 58100,
          "name": "现场",
          "alg": null
        }, {
          "id": 9102,
          "name": "演唱会",
          "alg": null
        }, {
          "id": 59101,
          "name": "华语现场",
          "alg": null
        }, {
          "id": 57108,
          "name": "流行现场",
          "alg": null
        }, {
          "id": 1100,
          "name": "音乐现场",
          "alg": null
        }, {
          "id": 5100,
          "name": "音乐",
          "alg": null
        }, {
          "id": 72116,
          "name": "短片",
          "alg": null
        }, {
          "id": 23116,
          "name": "音乐推荐",
          "alg": null
        }],
        "previewUrl": null,
        "previewDurationms": 0,
        "hasRelatedGameAd": false,
        "markTypes": null,
        "relateSong": [],
        "relatedInfo": null,
        "videoUserLiveInfo": null,
        "vid": "D2669D47F7011995AED7B88D058FD013",
        "durationms": 214994,
        "playTime": 2637334,
        "praisedCount": 13545,
        "praised": false,
        "subscribed": false
      }
    }, {
      "type": 1,
      "displayed": false,
      "alg": "onlineHotGroup",
      "extAlg": null,
      "data": {
        "alg": "onlineHotGroup",
        "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
        "threadId": "R_VI_62_695194266273BB0596388FB208D57C7B",
        "coverUrl": "https://p1.music.126.net/WlU1HZYmXrhPHVtEBR8JzQ==/109951164145423573.jpg",
        "height": 1080,
        "width": 1920,
        "title": "水桶腰和大粗腿又来了",
        "description": "",
        "commentCount": 1107,
        "shareCount": 117,
        "resolutions": [{
          "resolution": 240,
          "size": 46602407
        }, {
          "resolution": 480,
          "size": 58642816
        }, {
          "resolution": 720,
          "size": 104391885
        }, {
          "resolution": 1080,
          "size": 135232928
        }],
        "creator": {
          "defaultAvatar": false,
          "province": 1000000,
          "authStatus": 0,
          "followed": false,
          "avatarUrl": "http://p1.music.126.net/Sb2Vpw5Moq37KTirZQ0bNQ==/18497084116244881.jpg",
          "accountStatus": 0,
          "gender": 1,
          "city": 1002000,
          "birthday": -2209017600000,
          "userId": 474289498,
          "userType": 0,
          "nickname": "狗狗狗狗狗狗狗猫",
          "signature": "我的沉默就是猫猫的沉默，咪咪而喵喵",
          "description": "",
          "detailDescription": "",
          "avatarImgId": 18497084116244880,
          "backgroundImgId": 18905002928531110,
          "backgroundUrl": "http://p1.music.126.net/OhwUHB-Xb5mu20ov_7NnwQ==/18905002928531111.jpg",
          "authority": 0,
          "mutual": false,
          "expertTags": null,
          "experts": null,
          "djStatus": 0,
          "vipType": 0,
          "remarkName": null,
          "avatarImgIdStr": "18497084116244881",
          "backgroundImgIdStr": "18905002928531111"
        },
        "urlInfo": {
          "id": "695194266273BB0596388FB208D57C7B",
          "url": "http://vodkgeyttp9.vod.126.net/vodkgeyttp8/c6wBdbVM_2546807864_uhd.mp4?ts=1626688592&rid=B38FBDA3D344E5C8ACE3974EF4B61711&rl=3&rs=CnkhxlwSHHKjSKRLIHivCtSKSzlxfCCV&sign=15c918790ee02a03a5bfb5b10e8d98cb&ext=FP7PYoEh0lMPpVY2vG%2BgPY0v3Xc9jOqvfcKGzhLSsy97pW1mOiVF3fHE5qPEaoKkxdqP%2BM1m6mlhYRQjadYaZGmMqrwAQEqf91HeSu1Ft0J%2F4EgsrPvdh7irhrjX0yZbySP%2BWNZKdOM%2BhtGEDdk4KM9Slhm5FVv6aC0l9dZ3ApvgfdCWdkKdhwrfswug5ruS1dw%2B4NPeKo4JzocPaCp4oljLPqZWYHegaRC4SXk%2F%2FKMuW9n%2BDiROtAjWr4w5e01G",
          "size": 135232928,
          "validityTime": 1200,
          "needPay": false,
          "payInfo": null,
          "r": 1080
        },
        "videoGroup": [{
          "id": 58100,
          "name": "现场",
          "alg": null
        }, {
          "id": 9102,
          "name": "演唱会",
          "alg": null
        }, {
          "id": 57106,
          "name": "欧美现场",
          "alg": null
        }, {
          "id": 57108,
          "name": "流行现场",
          "alg": null
        }, {
          "id": 1100,
          "name": "音乐现场",
          "alg": null
        }, {
          "id": 5100,
          "name": "音乐",
          "alg": null
        }, {
          "id": 64100,
          "name": "Taylor Swift",
          "alg": null
        }],
        "previewUrl": null,
        "previewDurationms": 0,
        "hasRelatedGameAd": false,
        "markTypes": null,
        "relateSong": [],
        "relatedInfo": null,
        "videoUserLiveInfo": null,
        "vid": "695194266273BB0596388FB208D57C7B",
        "durationms": 187432,
        "playTime": 896239,
        "praisedCount": 2884,
        "praised": false,
        "subscribed": false
      }
    }]
    let videoList = this.data.videoList;
    videoList.push(...newVideoList)
    this.setData({
      videoList
    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function ({from}) {
    if(from==='menu'){
      return {
        title:'来自Menu的转发',
        path:'/pages/video/video',
        imageUrl:'/static/images/nvsheng.jpg'
      }
    }else {
      return {
        title:'来自Button的转发',
        path:'/pages/video/video',
        imageUrl:'/static/images/nvsheng.jpg'
      }
    }
  }
})